Skip to main content

Incidents API

The Incidents API endpoint allows you to query and retrieve security incidents detected by Cyberhaven. This endpoint provides access to policy violations, data exfiltration attempts, and other security events.

Endpoint

POST /api/rest/v1/incidents/list

Request Format

Basic Request

curl -H 'content-type: application/json' \
-H "Authorization: Bearer $TOKEN" \
https://$DEPLOYMENT/api/rest/v1/incidents/list \
-k --data '{}'

Request with Filters

curl -H 'content-type: application/json' \
-H "Authorization: Bearer $TOKEN" \
https://$DEPLOYMENT/api/rest/v1/incidents/list \
-k --data '{
"filters": {
"resolution_statuses": ["unresolved"],
"severities": ["high", "critical"],
"users": ["john.doe@company.com"]
},
"page_size": 50,
"sort_by": "trigger_time",
"sort_desc": true
}'

Request Parameters

Filter Parameters

ParameterTypeDescription
assigneesarray[string]Filter by assigned users
category_idsarray[string]Filter by category IDs
category_namesarray[string]Filter by category names
content_tagsarray[string]Filter by content tags
dataset_idsarray[string]Filter by dataset IDs
dataset_namesarray[string]Filter by dataset names
filesarray[string]Filter by file names
incident_idsarray[string]Filter by specific incident IDs
incident_reactionsarray[string]Filter by user reactions
incident_responsesarray[string]Filter by system responses
personal_infoarray[string]Filter by PII types
resolution_statusesarray[string]Filter by resolution status
severitiesarray[string]Filter by severity levels
usersarray[string]Filter by user emails

Pagination Parameters

ParameterTypeDescription
page_idstringToken for next page
page_sizeintegerNumber of results per page (max 1000, default 50)

Sorting Parameters

ParameterTypeDescription
sort_bystringField to sort by
sort_descbooleanSort in descending order

Sort Fields

FieldDescription
resolution_statusSort by resolution status
severitySort by severity level
datasetSort by dataset name
dataset_idSort by dataset ID
categorySort by category name
category_idSort by category ID
userSort by user name
fileSort by file name
personal_infoSort by PII column
incident_responseSort by system response
incident_reactionsSort by user reactions
event_timeSort by event timestamp
assigneeSort by assignee

Filter Values

Resolution Statuses

ValueDescription
unresolvedIncidents requiring attention
in_progressIncidents being investigated
resolvedIncidents marked as resolved
ignoredIncidents marked as false positives

Severities

ValueDescription
criticalCritical severity incidents
highHigh severity incidents
mediumMedium severity incidents
lowLow severity incidents
informationalInformational incidents

Incident Reactions

ValueDescription
noneNo user reaction
acknowledgedUser acknowledged the incident
provided_explanationUser provided explanation
requested_reviewUser requested review
requested_unblockUser requested unblock
warnedUser was warned
not_applicableNot applicable

Incident Responses

ValueDescription
pendingResponse pending
warning_receivedWarning delivered
warnedUser was warned
access_restrictedAccess was blocked
access_restricted_expiredBlock expired
access_restricted_rate_limitedRate limited block
access_restricted_removedBlock removed
skipped_rate_limitedSkipped due to rate limit
skipped_timeoutSkipped due to timeout
not_applicableNot applicable

Response Format

Response Structure

{
"incidents": [
{
"id": "incident-123",
"alert_id": "alert-456",
"assignee": "admin@company.com",
"category": {
"id": "cat-789",
"name": "Financial Data",
"description": "Financial information protection"
},
"dataset": {
"id": "ds-101",
"name": "Credit Card Numbers",
"description": "Credit card data detection"
},
"data": {
"hostname": "laptop-001",
"local_user_name": "john.doe",
"path": "/Users/john/Documents/financial.xlsx",
"file_size": 2048576
},
"edge": {
"source": {
"location": "endpoint",
"path": "/Users/john/Documents/financial.xlsx"
},
"destination": {
"location": "cloud_storage",
"domain": "dropbox.com"
}
},
"event_time": "2024-01-15T10:30:00Z",
"trigger_time": "2024-01-15T10:30:05Z",
"response_time": "2024-01-15T10:30:10Z",
"resolution_status": "unresolved",
"severity": "high",
"user": "john.doe@company.com",
"file": "financial.xlsx",
"content_tags": ["credit_card", "financial"],
"personal_info": ["credit_card_number"],
"incident_response": "access_restricted",
"incident_reactions": ["acknowledged"],
"explanation": "User acknowledged the incident"
}
],
"total": 150,
"next_page_id": "eyJwYWdlIjoyLCJzaXplIjo1MH0="
}

Response Fields

FieldTypeDescription
incidentsarray[Incident]Array of incident objects
totalintegerTotal number of matching incidents
next_page_idstringToken for next page (if available)

Incident Object Fields

FieldTypeDescription
idstringUnique incident identifier
alert_idstringAssociated alert ID
assigneestringAssigned user email
categoryobjectPolicy category information
datasetobjectDataset information
dataobjectEvent data details
edgeobjectData flow information
event_timestringWhen the event occurred
trigger_timestringWhen the incident was triggered
response_timestringWhen the response was delivered
resolution_statusstringCurrent resolution status
severitystringIncident severity level
userstringUser involved in the incident
filestringFile name involved
content_tagsarray[string]Content classification tags
personal_infoarray[string]PII types detected
incident_responsestringSystem response taken
incident_reactionsarray[string]User reactions
explanationstringUser-provided explanation

Example Requests

Get All Unresolved Incidents

{
"filters": {
"resolution_statuses": ["unresolved"]
},
"sort_by": "trigger_time",
"sort_desc": true
}

Get High Severity Incidents for Specific User

{
"filters": {
"severities": ["high", "critical"],
"users": ["john.doe@company.com"],
"resolution_statuses": ["unresolved", "in_progress"]
},
"page_size": 25
}

Get Incidents by Category

{
"filters": {
"category_names": ["Financial Data", "PII"],
"resolution_statuses": ["unresolved"]
},
"sort_by": "severity"
}

Get Incidents with Specific Content Tags

{
"filters": {
"content_tags": ["credit_card", "ssn", "passport"],
"severities": ["high", "critical"]
}
}

Time Filtering

To filter incidents by time range, use the times_filter parameter:

{
"filters": {
"times_filter": {
"start_time": "2024-01-01T00:00:00Z",
"end_time": "2024-01-31T23:59:59Z"
}
}
}

Error Responses

Common Error Codes

CodeDescriptionSolution
400Invalid filter parametersCheck filter values and types
401Authentication failedVerify access token
403Insufficient permissionsContact administrator
500Internal server errorContact support

Error Response Format

{
"error": {
"code": "INVALID_FILTER",
"message": "Invalid severity value provided",
"details": {
"field": "severities",
"value": "invalid_severity"
}
}
}

Integration Examples

Python Example

import requests
import json

def get_incidents(token, deployment, filters=None):
url = f"https://{deployment}/api/rest/v1/incidents/list"
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {token}'
}

payload = {}
if filters:
payload['filters'] = filters

response = requests.post(url, headers=headers, json=payload, verify=False)
return response.json()

# Get unresolved high severity incidents
filters = {
"resolution_statuses": ["unresolved"],
"severities": ["high", "critical"]
}

incidents = get_incidents(token, deployment, filters)
print(f"Found {incidents['total']} incidents")

PowerShell Example

$headers = @{
'Content-Type' = 'application/json'
'Authorization' = "Bearer $token"
}

$body = @{
filters = @{
resolution_statuses = @("unresolved")
severities = @("high", "critical")
}
} | ConvertTo-Json -Depth 3

$response = Invoke-RestMethod -Uri "https://$deployment/api/rest/v1/incidents/list" `
-Method Post -Headers $headers -Body $body

Write-Output "Found $($response.total) incidents"

Best Practices

  1. Use Specific Filters: Apply filters to reduce response size and improve performance
  2. Implement Pagination: Use page_size and next_page_id for large result sets
  3. Sort Results: Use sort_by and sort_desc to get results in desired order
  4. Handle Rate Limits: Implement retry logic with exponential backoff
  5. Monitor Resolution Status: Track incident resolution progress over time